package roborally.model.executables;

/**
 * An abstract class representing an "Executable" as an executable componenets of a Program.
 */
public abstract class Executable {
	/**
	 * A method that checks whether or not an other Executable is contained within this Executable.
	 * @param other
	 * @return If this Executable is composed of (an) other executable(s), true is returned if this Executable contains the given Executable. 
	 * 			If this Executable is not composed of (an) other executable(s), the value of this.equals(other) is returned.
	 */
	public abstract boolean contains(Executable other);
	
	/**
	 * A method which will execute the first RobotCommand that comes after 'lastExecutedRobotCommand' in the leaves of the ordered Tree with this Executable as headelement. 
	 * @return	True if a next RobotCommand was Executed. False if there was no next RobotCommand to be executed in this Executable.
	 */
	public abstract boolean executeNextRobotCommand(RobotCommand lastExecutedRobotCommand);
}
